package cz.czu.pef.DataModelling.domainObjects;

public class Machinery extends IdObjectImpl implements IdObject
{
  private static final long serialVersionUID = 6913267991598003815L;

  /*
	 * Entity attributes
	 */
	private String machinerySerialNo;

	/*
	 * Relations
	 */
	private Company companyOwner;
	private Person personOwner;
	private MachineType machineType;

	public Machinery(String machineSerialNo, MachineType machineType, Person personOwner, Company companyOwner)
	{
		super();
		this.setMachineType(machineType);
		this.setPersonOwner(personOwner);
		this.setCompanyOwner(companyOwner);
		this.machinerySerialNo = machineSerialNo;
	}

	public Machinery()
	{
		super();
	}

	public Machinery(String machineSerialNo)
	{
		super();
		this.machinerySerialNo = machineSerialNo;
	}

	public void setMachineSerialNo(String machineSerialNo)
	{
		this.machinerySerialNo = machineSerialNo;
	}

	public String getMachineSerialNo()
	{
		return machinerySerialNo;
	}
	
	public MachineType getMachineType()
	{
		return machineType;
	}
	
	public void setMachineType(MachineType machineType)
	{
		this.machineType = machineType;
	}
	
	public Person getPersonOwner()
	{
		return personOwner;
	}
	
	public void setPersonOwner(Person personOwner)
	{
		this.personOwner = personOwner;
	}

	public Company getCompanyOwner()
	{
		return companyOwner;
	}
	
	public void setCompanyOwner(Company companyOwner)
	{
		this.companyOwner = companyOwner;
	}

	
  public String getMachinerySerialNo()
  {
    return machinerySerialNo;
  }

  
  public void setMachinerySerialNo(String machinerySerialNo)
  {
    this.machinerySerialNo = machinerySerialNo;
  }

  public String toString()
	{
		StringBuilder builder = new StringBuilder();
		builder.append("Machinery [machineSerialNo=");
		builder.append(machinerySerialNo);
		builder.append(", machineType=");
		builder.append(machineType);
		builder.append(", toString()=");
		builder.append(super.toString());
		builder.append("]");
		return builder.toString();
	}
}
